package com.Action;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;

import java.util.Map;

public class LoginAction implements Action {
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    private String message;
    private String userName;

    @Override
    public String execute() throws Exception {
        this.setMessage("Hello,"+this.getUserName());
        Map<String,Object> session= ActionContext.getContext().getSession();
        session.put("message",this.getMessage());
        return "success";
    }
}
